package java57_5;

import java.util.Scanner;

public class ScoreStat {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int total = 0, s;
		boolean isNegative = false;
		for (int i = 1; i <= 5; i++) {
			System.out.println("input a score:");
			s = sc.nextInt();
			if (s < 0) {
				isNegative = true;
				break;
			}
			total += s;
		}
		//
		if (isNegative == false) {
			int avg = total / 5;
			System.out.println("average is " + avg);
		} else {
			System.out.println("input error");
		}
	}

}
